package com.zzw.basic.fanxing;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class GeneriConstructor {

	public static <T> T copy2(Collection<? super T> dest,Collection<T> src){
		T last = null;
		for(T ele:src){
			last = ele;
			dest.add(ele);
		}
		return last;
	}
	
	public static <T> T copy(Collection<T> dest,Collection<? extends T> src){
		T last = null;
		for(T ele:src){
			last = ele;
			dest.add(ele);
		}
		return last;
	}
	
	public <T> GeneriConstructor(T t){
		System.out.println(t);
	}
	
	public static void main(String[] args) {
		List<Number> ln = new ArrayList<>();
		List<Integer> li = new ArrayList<>();
		ln.add(1);
		Integer last = copy2(ln, li);
		/*new GeneriConstructor("123");
		new GeneriConstructor(123);
		new <String> GeneriConstructor("123");*/
	}
}
